﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

// Some help from: http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP

namespace Streaming_Service.FileTransfer {
    using System.IO;
    using System.Runtime.Serialization;
    using System.ServiceModel;

    using Streaming_Service.User;

    [MessageContract]
    public class UploadFileInfo {
        [MessageHeader(MustUnderstand = true)]
        public UserSession Admin { get; set; }

        [MessageHeader(MustUnderstand = true)]
        public int MovieId { get; set; }

        // The filename of the file being transferred.
        [MessageHeader(MustUnderstand = true)]
        public string Filename { get; set; }

        // The size of the file being transferred.
        [MessageHeader(MustUnderstand = true)]
        public long Size { get; set; }

        // If the file is in HD (Movies Only).
        [MessageHeader(MustUnderstand = true)]
        public bool IsHD { get; set; }

        // The stream to read the file from.
        [MessageBodyMember(Order = 2)]
        public Stream FileByteStream { get; set; }

        // The temporary filename, shall not be a DataMember
        public string TmpFilename { get; set; }
    }

    [MessageContract]
    public class UploadFileResponse {
        [MessageHeader(MustUnderstand = true)]
        public bool Success { get; set; }

        public UploadFileResponse(bool success) {
            Success = success;
        }
    }
}